package com.project.common.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * yes or no
 *
 * @Author WangYan
 * @Date 2022/7/12 14:15
 */
@Getter
@AllArgsConstructor
public enum DelFlagEnum {

    NOT_DELETED(0, "未删除"),
    HAS_DELETED(1, "已删除"),
    ;
    private int code;
    private String remark;

    /**
     * 当前值已删除 返回 ture
     * 当前值未删除 返回 false
     */
    public static boolean hasDeleted(Integer code) {
        if (code == null) {
            return false;
        }
        return DelFlagEnum.HAS_DELETED.getCode() == code.intValue();
    }
}
